Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native call tracer #6945

Merged
merged 18 commits into from
May 2, 2024
Merged

Add native call tracer #6945

merged 18 commits into from
May 2, 2024

Conversation

natebeauregard
Copy link
Contributor

@natebeauregard natebeauregard commented Apr 24, 2024

Changes

Adds a native call tracer implementation to the nethermind client. The callTracer tracks all the call frames executed during a transaction, including depth 0. The result will be a nested list of call frames, resembling how EVM works. They form a tree with the top-level call at root and sub-calls as children of the higher levels.

Users can conditionally only select the main call or add emitted logs to the call stack as well depending on the tracerConfig that they pass in.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Documentation

Requires explanation in Release Notes

  • Yes
  • No

The ReportOperationLog method and IsTracingOpLevelLogs flag was added to the ITxTracer interface to allow tracing logs emitted at the operation level.

@natebeauregard natebeauregard force-pushed the feature/native-call-tracer branch from d52b377 to 11f180e Compare April 24, 2024 22:52
@natebeauregard natebeauregard marked this pull request as ready for review April 24, 2024 23:16
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benaadams we need your review on VirtualMachine stuff

@natebeauregard
Copy link
Contributor Author

@LukaszRozmej I added a commit to update all of the list fields to use ArrayPoolList and then dispose of the array pools after the trace is serialized. Also, while conducting some final testing I noticed a bug where SELFDESTRUCT opcodes were being returned in a child call frame for the geth traces but not in nethermind so I added some additional logic to our call tracer to support that behavior.

Since some of these updates were non-trivial, especially in regards to the ArrayPoolList disposals, would you be able to look over the recent commits (Use ArrayPoolList for list objects, Fix selfdestruct bug) to see if you have any additional concerns prior to merging this?

@natebeauregard natebeauregard merged commit 7733036 into master May 2, 2024
67 checks passed
@natebeauregard natebeauregard deleted the feature/native-call-tracer branch May 2, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants